home *** CD-ROM | disk | FTP | other *** search
- 100 poke53281,1:bg=53280:pokebg,14
- 110 print"[147] [204][207][193][196][211][212][193][210] [208]resents:"
- 120 print" [195]ommodore 64 "
- 130 print" [205]agic [205]usic [194]ox "
- 140 print"[144] [215]ritten by: [196]onald [202]. [197]ddington"
- 150 print" (c) [195]opyright 1987"
- 160 forn=1to9:readh,l:nh(n)=h:nl(n)=l:next
- 170 data16,195,18,209,21,31,22,96,25,30,28,49,31,165,33,135,37,162
- 180 poke54296,10:poke54277,47:poke54278,12
- 190 print"[151] [212]his program takes your melody"
- 200 print" and feeds it into the [205]agic [205]usic [194]ox"
- 210 print" which processes it, then plays it"
- 220 print" forwards, backwards, inverted,"
- 230 print" [156]or backwards and inverted."
- 240 print" [208]ress [[211][208][193][195][197][194][193][210]] to continue"
- 250 print" or press [[198]1] for demo."
- 260 m$="40450568640140454566640140450568644090050866644"
- 270 poke198,0:wait198,1:geta$:ifa$<>" "anda$<>"[133]"then270
- 280 ifa$="[133]"thendemo=1:goto460
- 290 print"[147][144] [206]ow, enter your series of notes
- 300 [153]" using this system:"
- 310 [153]"1=mid-c","2=d","3=e","4=f":[153]"5=g","6=a","7=b","8=hi-c"
- 320 [153]"9=hi-d","0=rest"
- 330 [153]"valnter your melody, then press [(NULL)val(NULL)(NULL)(NULL)(NULL)]"
- 340 ls[178]78:[141]1340:[139]m$[178]""[167]290
- 350 [153]"load (NULL)ow, select the way you want it played"
- 360 [153]" atn> asc(NULL)(NULL)(NULL)atn(NULL)str$(NULL)":[153]" peek> peekatnlen(NULL)(NULL)atn(NULL)str$(NULL)"
- 370 [153]" len> right$(NULL)(NULL)val(NULL)(NULL)valstr$"
- 380 [153]"clr str$> peekatnlen(NULL)(NULL)atn(NULL)str$(NULL) and right$(NULL)(NULL)val(NULL)(NULL)valstr$":[153]"stop val> right$(NULL)(NULL)(NULL)(NULL) (NULL)val(NULL) (NULL)val(NULL)(NULL)str$(NULL)"
- 390 [153]"verify asc> val(NULL)str$ (NULL)(NULL)(NULL)chr$(NULL)atn(NULL) ((NULL)eturn to (NULL)(NULL)atnstr$(NULL)(NULL)atn(NULL))stop"
- 400 [153]"verify chr$> peekatnlen(NULL)close(NULL)(NULL)closeascright$(NULL)(NULL)(NULL)close(NULL)len(NULL)valval(NULL) (for demo)"
- 410 [151]198,0:[146]198,1:[161]w$:[139]w$[179]"a"[176]w$[177]"g"[167]410
- 420 w[178][198](w$)[171]64
- 430 :
- 440 [145]w[137]460,620,770,930,290,1100
- 450 [139]w[178]7[167][138]
- 460 [143] play the melody **-forwards-**
- 470 [153]"load"[199](142)," forwards ":[151]bg,5:[141]1140
- 480 [153],"verify it goes in here!!poke":[153]m$:[129]d[178]1[164]500:[130]d
- 490 a$[178]m$:f$[178]m$:[153]"";a$;
- 500 p[178][195](a$)[171]1:[129]t[178]1[164][195](a$):a$[178]" "[170][200](a$,p)[170]" (NULL)"
- 510 [153]"";a$;:[129]d[178]1[164]34:[130]d :[129]k[178]1[164]3:[141]1230:[130]k,t
- 520 [151]1344[170]i,32:[141]1280
- 530 [129]t[178]0[164][195](m$):t$[178][201](m$,t):[153]""[166]8)"(NULL) "t$
- 540 [129]d[178]1[164]50:[130]:[130]:[129]d[178]1[164]500:[130]
- 550 [129]q[178]1[164][195](m$)
- 560 g[178]([198]([202](m$,q,1))[171]48)
- 570 [139]g[179]0[176]g[177]9[167]g[178]0
- 580 [151]54273,nh(g):[151]54272,nl(g):[151]54276,33
- 590 [129]d[178]1[164]77:[130]d:[151]54276,32:[130]q
- 600 [129]x[178]1[164]1234:[130]:[151]54273,0:[151]54272,0:[139]demo[167][138]
- 610 [137]350
- 620 [143] play the melody **-backwards-**
- 630 [153]"load"[199](142)," backwards! ":[151]bg,2:[141]1140
- 640 [153],"verify it goes in here!!poke":[153]m$:[129]d[178]1[164]500:[130]d
- 650 a$[178]m$:[129]t[178][195](m$)[164]1[169][171]1:b$[178]b$[170][202](m$,t,1):[130]:[153]""a$;
- 660 p[178][195](a$)[171]1:[129]t[178]1[164][195](a$):a$[178]" "[170][200](a$,p)[170]" (NULL)"
- 670 [153]"";a$;:[129]d[178]1[164]34:[130]d :[129]k[178]1[164]3:[141]1230:[130]k,t
- 680 [151]1344[170]i,32:[141]1280
- 690 [129]t[178]0[164][195](m$):t$[178][201](b$,t):[153]""[166]8)"(NULL) "t$
- 700 [129]d[178]1[164]50:[130]:[130]:[129]d[178]1[164]500:[130]
- 710 [129]q[178][195](m$)[164]1[169][171]1
- 720 g[178]([198]([202](m$,q,1))[171]48)
- 730 [139]g[179]0[176]g[177]9[167]g[178]0
- 740 [151]54273,nh(g):[151]54272,nl(g):[151]54276,33
- 750 [129]d[178]1[164]77:[130]d:[151]54276,32:[130]q
- 760 [129]x[178]1[164]1234:[130]:[151]54273,0:[151]54272,0:[137]350
- 770 [143] play the melody **-inverted-**
- 780 [153]"load"[199](142)," inverted!! ":[151]bg,6:[141]1140
- 790 [153],"verify it goes in here!!poke":[153]m$:[129]d[178]1[164]500:[130]d
- 800 a$[178]m$:[129]t[178]1[164][195](m$):s[178]10[171]([197]([202](m$,t,1))):[139]s[178]10[167]i$[178]i$[170]"0":[137]807
- 805 i$[178]i$[170][199](s[170]48)
- 807 [130]
- 810 [153]""a$;:p[178][195](a$)[171]1:[129]t[178]1[164][195](a$):a$[178]" "[170][200](a$,p)[170]" (NULL)"
- 820 [153]"";a$;:[129]d[178]1[164]34:[130]d :[129]k[178]1[164]3:[141]1230:[130]k,t
- 830 [151]1344[170]i,32:[141]1280
- 840 [129]t[178]0[164][195](m$):t$[178][201](i$,t):[153]""[166]8)"(NULL) "t$
- 870 [129]d[178]1[164]50:[130]:[130]:[129]d[178]1[164]500:[130]
- 880 [129]q[178]1[164][195](m$)
- 890 g[178]10[171]([197]([202](m$,q,1)))
- 900 [151]54273,nh(g):[151]54272,nl(g):[151]54276,33
- 910 [129]d[178]1[164]77:[130]d:[151]54276,32:[130]q
- 920 [129]x[178]1[164]1234:[130]:[151]54273,0:[151]54272,0:[137]350
- 930 [143] play the melody **-inverted and backwards-**
- 940 [153]"load"[199](142),"cmdcmdcmd inverted and backwards ":[151]bg,4:[141]1140
- 950 [153],"verify it goes in here!!poke":[153]m$:[129]d[178]1[164]500:[130]d
- 960 a$[178]m$:[129]t[178][195](m$)[164]1[169][171]1:s[178]10[171]([197]([202](m$,t,1)))
- 965 [139]s[178]10[167]ib$[178]ib$[170]"0":[137]972
- 970 ib$[178]ib$[170][199](s[170]48)
- 972 [130]
- 980 [153]""a$;:p[178][195](a$)[171]1:[129]t[178]1[164][195](a$):a$[178]" "[170][200](a$,p)[170]" (NULL)"
- 990 [153]"";a$;:[129]d[178]1[164]34:[130]d :[129]k[178]1[164]3:[141]1230:[130]k,t
- 1000 [151]1344[170]i,32:[141]1280
- 1010 [129]t[178]0[164][195](m$):t$[178][201](ib$,t):[153]""[166]8)"(NULL) "t$
- 1040 [129]d[178]1[164]50:[130]:[130]:[129]d[178]1[164]500:[130]
- 1050 [129]q[178][195](m$)[164]1[169][171]1
- 1060 g[178]10[171]([197]([202](m$,q,1)))
- 1070 [151]54273,nh(g):[151]54272,nl(g):[151]54276,33
- 1080 [129]d[178]1[164]77:[130]d:[151]54276,32:[130]q
- 1090 [129]x[178]1[164]1234:[130]:[151]54273,0:[151]54272,0:[137]350
- 1100 [143] the program ends with a siren / color / print routine
- 1110 [153]" (NULL)he end! "
- 1120 [129]d[178]1[164]1111:[130]
- 1130 [137]1490
- 1140 [143] draw picture of magic music box
- 1150 [151]1384,79:[151]1423,80:[129]t[178]1385[164]1422:[151]t,119:[130]
- 1160 [129]t[178]55656[164]55695:[151]t,0:[130]
- 1170 sp[178][195](m$):[151]1344[170]sp,78:[151]1344[170]sp[170]39,32:[151]1344[170]sp[170]38,32
- 1180 [151]55616[170]sp,0:[151]1344[170]sp[171]1,32
- 1190 [151]1424,116:[151]1463,106:[151]55696,0:[151]55735,0
- 1200 [151]1464,76:[151]1503,122:[129]t[178]1465[164]1502:[151]t,111:[130]
- 1210 [129]t[178]55736[164]55775:[151]t,0:[130]
- 1220 [142]
- 1230 [143] make the magic music box process the melody
- 1240 g[178][187](1)[172]38:c[178][187](1)[172]16:j[178]([187](1)[172]11)[170]48:i[178]sp[171]1:n[178][187](1)[172]10
- 1250 [151]1425[170]g,j:[151]55697[170]g,c:[151]1344[170]i,86:[151]55616[170]i,c
- 1260 [151]54273,nh(n):[151]54272,nl(n):[151]54276,17:[129]d[178]1[164]3:[151]54276,16
- 1270 [142]
- 1280 [143] open the magic music box and let the melody out
- 1290 [129]t[178]55736[164]55775:[151]t,0:[130]:[151]1471,32:[151]1472,32
- 1300 [151]1511,77:[151]55783,0
- 1310 [153]"stopand it comes out here!"
- 1320 [129]d[178]1[164]1111:[130]
- 1330 [142]
- 1340 [143] input a string
- 1350 m$[178]""
- 1360 ag$[178]"to"
- 1370 [153]">";
- 1380 [153]ag$"cmd";
- 1390 [151]198,0:[146]198,1:[161]a$
- 1400 [139]a$[178][199](13)[167]1480
- 1410 fl[178]0:[139]a$[178]"cmd"[176]a$[178][199](20)[167]ag[178][195](m$):[139]ag[177]0[167][153]" cmdcmd cmd";:fl[178]1
- 1420 [139]fl[178]1[167]m$[178][200](m$,ag[171]1):[137]1380
- 1430 [139]a$[179]"0"[176]a$[177]"9"[167]1390
- 1440 [139][195](m$)[178]ls[167]1460
- 1450 [153]a$;:m$[178]m$[170]a$
- 1460 [137]1380
- 1470 :
- 1480 [139][195](m$)[178]40[167]m$[178]m$[170]"00"
- 1482 [139][195](m$)[178]39[167]m$[178]m$[170]"000"
- 1485 [142] : [143] m$=input string
- 1490 [143] re-connect
- 1500 [159]15,8,15,"r0:hello connect=hello connect":[132]15,er:[160]15
- 1510 [139]er[179][177]63[167][128]
- 1520 [159]15,8,15,"i0":[160]15
- 1530 [147]"hello connect",8
-